fixed #39, #40

Signed-off-by: Oliver Lillie <buggedcom@gmail.com>