fix compiler warnings, thanks Morten Stevens