(hopefully) final bug fixes