Bug fixes and feature addition