Fixes issues 1 and 3

Thanks to RemieRichards for the solution to these.