Added new features, for assembla task #82, and bug fixing.