WIP: fixed minor bugs