Function frames and minor improvements