fix return types & sync with svn