Fix breaking bug + enhance associated test