[Anton] Quick bug fix and code cleanup