fix condition. ASK is an ordertype
fix warning and eliminate unnecessary function
fix compiler / linker warnings