Finished crash fixes

Signed-off-by: Vinzenz Feenstra <evilissimo@gmail.com>