#7 fix warnings and exceptions