Also throws an exception if rename fails.