Replaced some ifs with asserts, added missing failure notifications