Fixed bugs. Improved interface.