Added enhancements and fixed issues from the previous version.