Fixed some compilation problems and warnings.

Signed-off-by: Kristian Duske <kristian.duske@gmail.com>