Huge bug fix in API