Finish up and fix #1172