runtime bug fixes