Some additions and fixes