Some bug fixes... still not working yet though :/