I've just discovered that the serial problems only appear if the board is connected to the RAMPS-FD, it works all right alone, powered via USB. When it's connected to the RAMPS-FD, it doesn't matter if it's powered via USB or the main power is connected.
Additionally, I've tried reading the firmware from the SainSmart's atmega16u2 and flashing it to the Arduino's (including the fuses), and it didn't fix anything.
Additionally, I've tried reading the firmware from the SainSmart's atmega16u2 and flashing it to the Arduino's (including the fuses), and it didn't fix anything.