Small fix and error improvements