marcin's fixes