Various fixes, add functions.