Some importatnt fixes