Eliminate error supression and handle corner cases better