bug fixes, (hopefully) final changes