Adding -O3 and fixing errors that come up when I add -O3.