Fixing some problems on merge #40