Fixed some issues according to Cheraine's idea