Fix some bugs that surfaced