Fixes and new functions