Add some changes from devel branch
A couple of small bug fixes