Fixed lots of stuff.

Signed-off-by: Olof Wallentin <olov.wallentin@gmail.com>