I was having the same issue. Had to read through the source code to figure it out...
If you focus entirely on Marla, you might fill up her third heart before the scene where she confesses to Lani, in which case you'll get the dildo scene. you have to wait until after the confession to fill up the third heart, then you'll get the library scene.