Bug fixes

Signed-off-by: Jack Harley <jackpharley@gmail.com>