minor fixes

shortened nested ifs
removed exception swallowing