some more fixes and functions