Fix gcc warnings/errors