Fix some things based on tests