Some fixes for you :)

One fix is for the bug introduced by myself (apologies).
The other two are to get rid of warnings.