Fixed ?: and some other important bugs