minor fill bug fix and put register_quit in top level