Fixed after Vitaliy's review