Adding tests + quirk fixes that came from having tests