Bug fixes and separate out CSS