[WIP] Miscellaneous bugs