Nearly fixed all standing issues, but will need a code review first.