More functions; bugfix