Added final tweaks, fixed bugs.