Joining objects = no ambient occlusion?

Hi, I’m having a strange problem where baking ambient occlusion for joined objects makes them NOT cast shadows on each other (only on themselves) and I only seem to get the proper shadows if I unjoin them and bake individually. I’m using the default material on all objects. Am I doing something wrong?

Thanks in advance!