Fixing various issues

Signed-off-by: Euan T <euantorano@gmail.com>