Fixes some bugs and adds some implementations.