Some minor bugfixes

Signed-off-by: Thomas Spycher <tspycher@zerodine.com>