Fixes error handling in SystemUtils.remove.