RMBP outputs 4k@60Hz ONLY when lid open

I've got a weird problem. I recently got a new Philips BDM4065UC UHD monitor for my Late 2013 15" retina MBP (it's amazing), connected it using DisplayPort 1.2 (also set on the display) and when using both the built-in display and the external screen, everything works amazing, the image is butter smooth at full resolution and 60Hz.

However, when I try to use my MacBook in closed clamshell mode (the screen is ridiculously huge, there's no point in using the built-in screen and there's not much space on my desk), it switches back to 30Hz. WTF?

I mean I would understand it the other way, but this just doesn't make sense. Is there some setting I'm missing? Since I'm not using the screen I'd like to use all the video memory for the external screen.


Solved!

The solution is about as weird as the problem. To enable 60Hz in clamshell mode, I had to Option-click the "Scaled" radio button on System preferences' Display resolution screen, then the Refresh Rate option became available and I could switch from 30 to 60Hz. For some reason it wasn't enabled by default when lid closed.

EDIT: Also found out that for some reason this issue is directly connected to my old USB hub. When the display is connected and working at 60Hz clamshell mode, just touching the computer surface with the USB connector lights up a small white spark and the display immediately switches to 30Hz and the option disappears. And this ONLY happens when the lid is closed.

This is easily the most interesting problem I've had with a mac in many years.

*throws the USB hub to trash immediately*

scaled resolution options