Finish up and fix #1157