Fix pin initialization when a mode argument is provided