Fixing compilation issues

Necessary to finish #1280. (I don't want to close it with this pull request because hiker only wrote a workaround and is going to do a good fix soon.)