Fix bugs in WIP