I had something similar happen a while back after I replaced a master cylinder. Turned out the new master cylinder was bad. The first thing you need to do is bleed the brakes and see if there is any air in the lines. If you only had the master cylinder worked on it's probably the problem. One important clue would be how the brakes worked before the master cylinder was changed. If all these problems started after te master cylinder was changed it might be a bad rebuilt part. Jim