Fixed more of the functionality