End of phase 3.
Minor bug fixes