Crack-free perovskite layers for high performance and reproducible devices via improved control of ambient conditions during fabrication