Feature additions and other bug fixes