Fixed some bugs

Signed-off-by: Oskar <oskar.warme@gmail.com>