I recently got into an argument (on the python list so more OT there than here :-) ) about whether a B# is the same as C. If we allow that they may not always be the same then we have a case where the theory-of-musical-harmony (may be) breaking.
I believe you would call it a B# if your key already had a C#, but you would call it a C if your key had a Db.