I know that in "The Perfect Puppy" by Gwen Bailey she talks about (generally) never shouting at your puppy/dog etc, but she does say that if your dog really oversteps the line, he knows it, you know it (i.e. there's no doubt that it was aggression and aimed at you) then you need to "discipline" him.
She recommends that you do what his mother would have done: something loud, shocking, fast (i.e. you react immediately and it's also a fast action/noise to maximise the shock factor). If it's done correctly, your dog should look shocked, maybe even cower a bit, and you then also do what his mother would do after "correcting" him by snarling - pet him to show that you've finished the lesson and it's forgotten (provided he doesn't do it again).
I discussed this with a friend with a beautifully well-trained, 10 stone Rhodesian Ridgeback, and she had used it a few times in the early days and was a big fan of it.
I've had to do this once with Paddy and it was miraculous. Instead of play biting (which is usually pretty gentle and no aggression) he really did bite at me and snarl menacingly because he'd managed to use a small footstool as a stepping stone to reach the armchair and I told him "off" while moving to lift him if he didn't shift voluntarily - and he didn't intend to shift.
I did exactly what Gwen Bailey recommends - moved so fast I shocked myself, never mind Paddy. I lunged at him (not with hands, just whole body) with my face/head further forward (but out of biting range) and I made a real snarling sound - loud, sudden - at him - and a snarling, contorted face. He looked really shocked, submissive tail wagging and everything. Jumped down, I petted him and told him he was a good boy, all gently toned voice, and I've never had any kind of repeat - and he doesn't try to get on furniture (and we never let him on anything either).
He wasn't cowed or submissive after my immediate petting, just got on with life, as did I. It genuinely did do "exactly what it says on the tin". Interestingly, because it was a conscious (albeit bloody fast!) decision on my part, not a reaction out of shock or anger, there really was no "boiling blood" hangover. I could move on immediately, not just "going through the motions".
I guess this is easy to say, as he's a puppy and small, and generally a gentle little lad. Hamish may be more of a handful but if you're willing to give it a go...
One footnote: Gwen Bailey subscribes to dominance behaviours. From the things I've read, I'm sceptical. I think (and offer this very humbly, as he's my first dog and it's mainly from reading up) that it is more to do with dog personality and home environment (eg a pushy, confident dog who is allowed to get away with murder will spiral to more difficult behaviours, not necessarily because he's acting out pack theory). What made sense about her "discipline" proposal though was that you're seeking to emulate what his mother would do to discipline him and then forgive him immediatley if the right behaviour is forthcoming.
Let us know how you get on.