Fix gcc48warnings

Fixes #262 and the second part of #265