Fixes the latest batch of bugs found in RC testing. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>