Added notspiff's bug fix to statelist
Added optimization flags for windows builds (to work around -O compiler bug)