Fix framework bugs, and add some convenience