Fixed final bug. Fixes #3