Small improvements to the api 

@lennartcl 
see #1563 and #1567