Fixes for stm32f4

This is to close #81 and hopefully #66.
Ah... that's @ah-'s fault ;) Will do in a bit.