Andrija fixed some nasty bugs