Fixed weird errors that showed up in gcc 4.6