Correct issues with the API

This include Peter's changes as well