Finalized bug fixes