Fix various ugly things