Adding forgotten file, fixing more bugs.