Added handling for withdrawal + misc minor changes