Merging from test_branch
small bugfixes